Skip to content

Reject external versioning when script is configured in OpenSearch sink#6773

Merged
dinujoh merged 1 commit into
opensearch-project:mainfrom
dinujoh:fix/reject-external-version-with-script
Apr 29, 2026
Merged

Reject external versioning when script is configured in OpenSearch sink#6773
dinujoh merged 1 commit into
opensearch-project:mainfrom
dinujoh:fix/reject-external-version-with-script

Conversation

@dinujoh

@dinujoh dinujoh commented Apr 21, 2026

Copy link
Copy Markdown
Member

Description

OpenSearch does not support external versioning with scripted upserts. Add config-time validation in IndexConfiguration to fail fast with a clear error message instead of getting runtime 400 errors from OpenSearch.

Check List

  • New functionality includes testing.
  • New functionality has a documentation issue. Please link to it in this PR.
    • New functionality has javadoc added
  • Commits are signed with a real name per the DCO

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

}

if (scriptConfiguration != null && openSearchSinkConfig.getVersionType() != null
&& VersionType.External.jsonValue().equalsIgnoreCase(openSearchSinkConfig.getVersionType())) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does OpenSearch accept this with different case? External, eXternal, EXTERNAL?

If not we should require strict equality.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OpenSearch only accepts external (lowercase) for version_type. The VersionType.External.jsonValue() returns external. I will make this fix

OpenSearch does not support external versioning with scripted upserts.
Add config-time validation in IndexConfiguration to fail fast with a
clear error message instead of getting runtime 400 errors from OpenSearch.

Signed-off-by: Dinu John <86094133+dinujoh@users.noreply.github.com>
@dinujoh dinujoh force-pushed the fix/reject-external-version-with-script branch from 98521f6 to cadaea2 Compare April 28, 2026 23:34
@dinujoh dinujoh merged commit f5ece59 into opensearch-project:main Apr 29, 2026
94 of 97 checks passed
simonelbaz pushed a commit to simonelbaz/data-prepper that referenced this pull request Apr 29, 2026
…nk (opensearch-project#6773)

OpenSearch does not support external versioning with scripted upserts.
Add config-time validation in IndexConfiguration to fail fast with a
clear error message instead of getting runtime 400 errors from OpenSearch.

Signed-off-by: Dinu John <86094133+dinujoh@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants